package com.gcb.common.enums;

/**
 * 性别枚举
 */
public enum SexTypeEnum {

    MAN(0, "男"),
    WOMAN(1, "女"),
    OTHER(2, "其他");

    private Integer code;

    private String info;

    SexTypeEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static String getInfo(Integer code) {
        for (SexTypeEnum sexType : SexTypeEnum.values()) {
            if (sexType.getCode().equals(code)) {
                return sexType.getInfo();
            }
        }
        return null;
    }
}
